package com.jsftoolkit.base.components;

import javax.faces.component.UIComponent;
import javax.faces.component.UIData;

import com.jsftoolkit.base.GenericDataRenderer;
import com.jsftoolkit.gen.DefaultConfigSpec;
import com.jsftoolkit.gen.info.PropertyInfo;

/**
 * 
 * 
 * @author noah
 * 
 */
/* Can't inherit from BaseSpec since it references PassThroughTag */
public class DataIteratorSpec extends DefaultConfigSpec {
	/**
	 * Is only valid as a value expression and can't be set directly.
	 */
	public static final PropertyInfo ROW_ID = new PropertyInfo(null, "rowId");

	public static final String PACKAGE = "com.jsftoolkit.base.components";

	public static final String CLASS_NAME = "DataIterator";

	public static final Class<? extends UIComponent> SUPER_CLASS = UIData.class;

	public static final boolean ABSTRACT = true;

	public static final String COMPONENT_TYPE = "com.jsftoolkit.DataIterator";

	public static final String COMPONENT_FAMILY = "javax.faces.Data";

	public static final String DEFAULT_RENDERER_TYPE = "com.jsftoolkit.GenericDataRenderer";

	public static final String REGISTER_RENDERER = GenericDataRenderer.class
			.getName();

	{
		abstractClass().in(PACKAGE).named(CLASS_NAME)
				.inFamily(COMPONENT_FAMILY).ofType(COMPONENT_TYPE);
		extending(SUPER_CLASS);
		withRenderer(DEFAULT_RENDERER_TYPE);
		
		withConfig().registeringRenderer(REGISTER_RENDERER);

		andProperty("ROW_ID", ROW_ID);
	}

}
